14. SIM related Commands > 14.4 AT^SXSM   Extended SIM Access

14.4
AT^SXSM   Extended SIM Access
AT^SXSM extends AT+CRSM with additional SIM commands.
All parameters of AT^SXSM are used as specified by GSM 11.11 [26]. TC65 handles internally all required SIM interface locking and file selection routines.
TC65 may return error result code "+CME ERROR" if the command cannot be passed to the SIM, e.g. if no SIM is inserted. However, errors related to SIM action are reported in <sw1> and <sw2> parameters as defined in GSM 11.11 [26].
Syntax
Test Command  
Response(s)
Write Command  
Response(s)
PIN 
ASC0 
ASC1 
USB 
MUX1 
MUX2 
MUX3 
Charge 
Last 

Parameter Description
 
136
RUN GSM ALGORITHM
Start the authentication mechanism and cipher key generation on the SIM. It runs the algorithms A3 and A8 using a 16 byte random number and the sub­scriber authentication key Ki, which is stored in the SIM.
 
Identifier for an elementary data file on SIM, if used by <command>.
 
<P1>(num)
Parameter to be passed on by the TC65 to the SIM.
 
<P2>(num)
Parameter to be passed on by the TC65 to the SIM.
 
<P3>(num)
Parameter to be passed on by the TC65 to the SIM.
 
<data>(str)
If <command>=136 (RUN GSM ALGORITHM):
16 byte random number.
 
<sw1>(num)
Status information from the SIM about the execution of the actual command. It is returned in both cases, on suc­cessful or failed execution of the command.
0...255
 
 
<sw2>(num)
Status information from the SIM about the execution of the actual command. It is returned in both cases, on suc­cessful or failed execution of the command.
0...255
 
 
Response in case of a successful completion of the previously issued SIM command.

If <command>=136 (RUN GSM ALGORITHM):
TC65 returns SRES and cipher key Kc as calculated by the SIM.
 


Example

Use <command>=136 (RUN GSM ALGORITHM) to obtain SRES and cipher key Kc values as calculated by the SIM.
 
at^sxsm=136,,0,0,16,"00112233445566778899AABBCCDDEEFF"
^SXSM: 144,0,00112233445566778899AABB